Skip to content

Conversation

@ilkivoo
Copy link
Owner

@ilkivoo ilkivoo commented May 4, 2018

No description provided.

@@ -0,0 +1,8 @@
Я вас любил: любовь еще, быть может,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

файлы для тестов обычно кладут в src/test/resources. а вообще для подобных тестов есть очень удобная штука https://junit.org/junit4/javadoc/4.12/org/junit/rules/TemporaryFolder.html

/** A server that processes two list requests and receives */
public class Server {
/** Value for request list */
public static int LIST_REQUEST = 1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хорошо бы информацию о сетевом протоколе как-то переиспользовать между клиентом и сервером

import java.net.Socket;

/** A server that processes two list requests and receives */
public class Server {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тесты это хорошо, но хотелось бы ещё консольный UI, чтобы запустить клиент и сервер и поперекачивать файлы

List<Pair<String, Boolean>> files = client.list(dirTestList1.getAbsolutePath() + "/test3");
assertEquals(0, files.size());

} catch (IOException e) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в тестах не принято ловить исключения. если тест должен бросать исключение, используйте параметр expected аннотации Test. а если не должен, то пишите throws у метода

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants